<template>
	<view>
		账号:<input style="width: 200px;background: #808080;" v-model="user.username"/>
		密码:<input style="width: 200px;background: #808080;" v-model="user.password"/>
		姓名:<input style="width: 200px;background: #808080;" v-model="user.name"/>
		性别:<input style="width: 200px;background: #808080;" v-model="user.gender"/>
		电话:<input style="width: 200px;background: #808080;" v-model="user.phone"/>
		学校:<input style="width: 200px;background: #808080;" v-model="user.schoolName"/>
		头像:<input style="width: 200px;background: #808080;" v-model="user.image"/>
		<button @click="changeInfo()">确定修改</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				user:{}
			}
		},
		onShow() {
			this.user=uni.getStorageSync("user");
		}
		,
		methods: {
			changeInfo(){
				uni.request({
				method:"POST",
				url:this.requestUrl+"/ForeUser/changeInfo",
				data:this.user,
				success:response=>{
					var flag=response.data;
					if(flag>0){
						uni.showToast({title: '保存成功！'});
						 uni.navigateTo({url:'../login/login'});
					}else{
						uni.showToast({title: '保存失败！'});
					}
				}	
				})
			}
		}
	}
</script>

<style>

</style>
